#ifdef __cplusplus
extern "C"
{
#endif

#include <libavutil/opt.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>

#ifdef __cplusplus
};
#endif

#include "sct/core/common.h"

#include "sct/encode/encodeinterface.h"

#include "sct/encode/videoenc.h"
#include "sct/encode/audioenc.h"

namespace sct
{

CEncodeInterface* CEncodeInterface::create(const char * name, const CodecType codecType)
{
	std::string n=name;

	if("encode" == n)
	{
		SCT_LOGD("create encode[%d]", codecType);
		switch(codecType)
		{
		case CT_H264:
		{
			return new CVideoEnc(codecType);
		}

		case CT_AAC:
		{
			return new CAudioEnc(codecType);
		}

		default:
		{
			SCT_LOGD();
			break;
		}
		}
	}

	return new CEncodeInterface(codecType);
}

void CEncodeInterface::initlib()
{
	avcodec_register_all();
}

}
